<?php
	include("db.php");

	if(isset($_GET["id"]) && isset($_GET["positif"])){

		$id = $_GET['id'];
		$positif = $_GET['positif'];
		$positif = $positif+1;

		try{
			$sql = "UPDATE BITCH
			 SET POSITIF = $positif
			 WHERE id=$id";
	        $stmt = $dbh->prepare($sql);
	        $stmt->execute();

	        $sql2 = "SELECT positif
			 FROM BITCH
			 WHERE id=$id";
	        $stmt = $dbh->prepare($sql2);
	        $stmt->execute();
	        $array = $stmt->fetchAll();

	        echo json_encode($array);
	    }
	    catch(Exception $e){
	        echo "Error GET ALL db";
	    }
	}


	